// 常量路由
export const constantRoutes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/pages/login/index.vue'),
    meta: {
      title: '登录',
      hidden: true
    }
  },
  {
    path: '/',
    name: 'loginR',
    redirect: '/login',
    meta: {
      title: '登录',
      hidden: true
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/pages/404/index.vue'),
    meta: {
      title: '404',
      hidden: true
    }
  },
  // { // 如果输入不存在的路由，直接定位到404
  //   path: '/:pathMatch(.*)*',
  //   name: 'anys',
  //   component: () => import('@/pages/404/index.vue'),
  //   meta: {
  //     title: '任意路由',
  //     hidden: true
  //   }
  // },
]

// 动态路由
export const asyncRoutes = [
  {
    path: '/home',
    name: 'index',
    meta: {
      title: '数据看板',
      hidden: false,
      icon: 'HomeFilled',
      showChild: true,
    },
    component: () => import('@/pages/home/index.vue'),
    children: [
      { //数据看板
        path: '',
        name: 'home',
        component: () => import('@/pages/dataBoard/index.vue'),
        meta: {
          title: '数据看板',
          hidden: false,
          icon: 'PieChart'
        }
      },
      
    ],
    
  },
  { // 成本管理
    path: '/cost',
    name: 'cost',
    meta: {
      title: '成本管理',
      hidden: false,
      icon: 'Coin'
    },
    component: () => import('@/pages/home/index.vue'),
    children: [
      {
        path: 'user',
        name: 'costUser',
        component: () => import('@/pages/cost/type.vue'),
        meta: {
          title: '人员管理',
          hidden: false,
        }
      },
      {
        path: 'device',
        name: 'costDevice',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '设备管理',
          hidden: false,
        }
      },
      {
        path: 'material',
        name: 'costMaterial',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '物料管理',
          hidden: false,
        }
      },
    ]
  },
  { // 库存管理
    path: '/stock',
    name: 'stock',
    meta: {
      title: '库存管理',
      hidden: false,
      icon: 'Van'
    },
    component: () => import('@/pages/home/index.vue'),
    children: [
      {
        path: 'stock',
        name: 'stockManage',
        component: () => import('@/pages/cost/type.vue'),
        meta: {
          title: '库存管理',
          hidden: false,
        }
      },
      {
        path: 'warning',
        name: 'stockWarning',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '库存预警',
          hidden: false,
        }
      },
    ]
  },
  { // 数据采集
    path: '/data',
    name: 'dataC',
    meta: {
      title: '数据采集',
      hidden: false,
      icon: 'DataLine',
      showChild: true,
    },
    component: () => import('@/pages/home/index.vue'),
    children: [
      {
        path: 'collection',
        name: 'dataCollection',
        component: () => import('@/pages/cost/type.vue'),
        meta: {
          title: '数据采集',
          hidden: false,
          icon: 'DataLine',
        }
      }
    ]
  },
  { // 设备管理
    path: '/device',
    name: 'device',
    meta: {
      title: '设备管理',
      hidden: false,
      icon: 'Setting'
    },
    component: () => import('@/pages/home/index.vue'),
    children: [
      {
        path: 'code',
        name: 'deviceCode',
        component: () => import('@/pages/cost/type.vue'),
        meta: {
          title: '设备编码',
          hidden: false,
        }
      },
      {
        path: 'keep',
        name: 'deviceDeep',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '维养预警',
          hidden: false,
        }
      },
      {
        path: 'fault',
        name: 'deviceFault',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '故障报警',
          hidden: false,
        }
      },
      {
        path: 'remote',
        name: 'deviceRemote',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '远程巡检',
          hidden: false,
        }
      },
      {
        path: 'report',
        name: 'deviceReport',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '统计报表',
          hidden: false,
        }
      },
    ]
  },
  { // 缺陷管理
    path: '/bug',
    name: 'bug',
    meta: {
      title: '缺陷管理',
      hidden: false,
      icon: 'Odometer'
    },
    component: () => import('@/pages/home/index.vue'),
    children: [
      {
        path: 'ng',
        name: 'bugNg',
        component: () => import('@/pages/cost/type.vue'),
        meta: {
          title: 'NG管理',
          hidden: false,
        }
      },
      {
        path: 'data',
        name: 'bugData',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '数据分析',
          hidden: false,
        }
      },
      {
        path: 'prevent',
        name: 'bugPrevent',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '缺陷预防',
          hidden: false,
        }
      },
    ]
  },
  { // 监控管理
    path: '/monitor',
    name: 'monitor',
    meta: {
      title: '监控管理',
      hidden: false,
      icon: 'VideoCamera'
    },
    component: () => import('@/pages/home/index.vue'),
    children: [
      {
        path: 'process',
        name: 'monitorProcess',
        component: () => import('@/pages/cost/type.vue'),
        meta: {
          title: '进度监控',
          hidden: false,
        }
      },
      {
        path: 'data',
        name: 'monitorData',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '数据分析',
          hidden: false,
        }
      },
      {
        path: 'device',
        name: 'monitorDevice',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '设备监控',
          hidden: false,
        }
      },
      {
        path: 'abnormal',
        name: 'monitorAbnormal',
        component: () => import('@/pages/cost/record.vue'),
        meta: {
          title: '异常预警',
          hidden: false,
        }
      },
    ]
  },
]

export const anyRoutes = [
  { // 如果输入不存在的路由，直接定位到404
    path: '/:pathMatch(.*)*',
    name: 'any',
    redirect: '/404',
    meta: {
      title: '任意路由',
      hidden: true
    }
  },
]